Skip to content

Upload to Github Container Registry#479

Merged
creativeprojects merged 3 commits into
masterfrom
upload-to-gcr
Mar 30, 2025
Merged

Upload to Github Container Registry#479
creativeprojects merged 3 commits into
masterfrom
upload-to-gcr

Conversation

@creativeprojects
Copy link
Copy Markdown
Owner

Fixes #477

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 30, 2025

Walkthrough

The pull request extends CI/CD workflows and Docker image configurations to support the GitHub Container Registry (ghcr.io). New steps have been added in GitHub Actions workflows to log in to ghcr.io alongside DockerHub. Additionally, GoReleaser configuration files have been updated with extra image templates and manifest entries for publishing images to ghcr.io for multiple architectures and tagging schemes.

Changes

Files Change Summary
.github/workflows/docker.yml, .github/workflows/release.yml, .github/workflows/snapshot.yml Added a new step for logging into GH Container Registry using docker/login-action@v3. In snapshot.yml, a new step to publish images to ghcr.io was introduced and the DockerHub publishing step was modified to use shell: bash.
.goreleaser-docker-only.yml, .goreleaser-snapshot.yml, .goreleaser.yml Introduced additional Docker image templates and corresponding manifest entries for the resticprofile project on ghcr.io, targeting both amd64 and arm64v8 architectures, including updates for nightly and versioned image tags.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant GA as GitHub Actions
    participant DH as DockerHub
    participant GHCR as GitHub Container Registry

    Dev->>GA: Push code changes
    GA->>DH: Login to DockerHub
    GA->>GHCR: Login to GH Container Registry (docker/login-action@v3)
    GA->>GHCR: Publish Docker images (snapshot workflow)
Loading

Assessment against linked issues

Objective Addressed Explanation
Publish to GH Container Registry (#477)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (4)
.github/workflows/docker.yml (1)

39-45: Addition of GitHub Container Registry Login Step with a Minor Formatting Fix

The new step to log in to ghcr.io is implemented correctly and nicely complements the existing DockerHub login. However, please remove any trailing whitespace on line 45 to meet YAML linting standards.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 45-45: trailing spaces

(trailing-spaces)

.github/workflows/release.yml (1)

34-40: GitHub Container Registry Login Integration

The new login step for ghcr.io is consistent with similar changes in other workflows, ensuring reliable multi-registry authentication. Please address the trailing spaces on line 40.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 40-40: trailing spaces

(trailing-spaces)

.github/workflows/snapshot.yml (2)

33-39: Implementation of GitHub Container Registry Login Step

The added login step for ghcr.io is consistent with the updates made in other workflows. Please verify that no extraneous trailing whitespace is present in this segment.


64-75: GitHub Container Registry Publishing Step with Minor Formatting Issues

The new step for publishing images to ghcr.io is well-implemented, correctly handling Docker manifest creation and push. Please remove trailing spaces on line 74 and ensure the file ends with a newline to satisfy YAML linting requirements.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 74-74: trailing spaces

(trailing-spaces)


[error] 75-75: no new line character at the end of file

(new-line-at-end-of-file)


[error] 75-75: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f3da182 and 598f2b9.

📒 Files selected for processing (6)
  • .github/workflows/docker.yml (1 hunks)
  • .github/workflows/release.yml (1 hunks)
  • .github/workflows/snapshot.yml (3 hunks)
  • .goreleaser-docker-only.yml (3 hunks)
  • .goreleaser-snapshot.yml (2 hunks)
  • .goreleaser.yml (3 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/docker.yml

[error] 45-45: trailing spaces

(trailing-spaces)

.github/workflows/release.yml

[error] 40-40: trailing spaces

(trailing-spaces)

.github/workflows/snapshot.yml

[error] 74-74: trailing spaces

(trailing-spaces)


[error] 75-75: no new line character at the end of file

(new-line-at-end-of-file)


[error] 75-75: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build and test (1.24, windows-latest)
🔇 Additional comments (10)
.goreleaser-snapshot.yml (2)

32-33: Addition of Image Template for GitHub Container Registry (amd64)

The new image template "ghcr.io/creativeprojects/resticprofile:nightly-amd64" has been added correctly and aligns well with the strategy of supporting multiple registries.


53-54: Addition of Image Template for GitHub Container Registry (arm64v8)

The inclusion of "ghcr.io/creativeprojects/resticprofile:nightly-arm64v8" is coherent with the other image templates and properly extends support for GitHub Container Registry.

.github/workflows/snapshot.yml (1)

53-63: DockerHub Publishing Step Update

The addition of shell: bash in the "Publish to DockerHub" step ensures commands are executed uniformly, which enhances the reliability of the workflow.

.goreleaser-docker-only.yml (3)

34-35: Addition of GitHub Container Registry Image Templates for amd64

The new templates "ghcr.io/creativeprojects/resticprofile:latest-amd64" and "ghcr.io/creativeprojects/resticprofile:{{ .RawVersion }}-amd64" have been correctly added. They effectively broaden the image publishing scope across both DockerHub and GitHub Container Registry.


57-58: Addition of GitHub Container Registry Image Templates for arm64v8

The newly introduced templates "ghcr.io/creativeprojects/resticprofile:latest-arm64v8" and "ghcr.io/creativeprojects/resticprofile:{{ .RawVersion }}-arm64v8" maintain consistency with the overall Docker configuration, which is a positive enhancement.


88-97: Expanded Docker Manifest Definitions for GitHub Container Registry

The extended manifest definitions for ghcr.io entries (both for the versioned and latest tags) have been integrated effectively. This change ensures a unified approach to image publishing across registries.

.goreleaser.yml (4)

137-138: Approved: New Docker Image Templates for ghcr.io on amd64.

The new entries "ghcr.io/creativeprojects/resticprofile:latest-amd64" and "ghcr.io/creativeprojects/resticprofile:{{ .RawVersion }}-amd64" have been added correctly. They follow the established naming conventions and align with the intention to support the GitHub Container Registry.


159-160: Approved: New Docker Image Templates for ghcr.io on arm64.

The added image templates "ghcr.io/creativeprojects/resticprofile:latest-arm64v8" and "ghcr.io/creativeprojects/resticprofile:{{ .RawVersion }}-arm64v8" correctly extend support for the arm64 architecture through the GitHub Container Registry.


188-192: Approved: Docker Manifest Entry for Versioned ghcr.io Images.

This new manifest entry groups architecture-specific images for the versioned ghcr.io image:

  • It consolidates the {{ .RawVersion }} tag with both amd64 and arm64 variants.
  • The templating is consistent with the rest of the file.

Everything is in order.


193-195: Approved: Docker Manifest Entry for Latest ghcr.io Images.

The manifest entry correctly maps the latest tag to the appropriate architecture-specific images for ghcr.io. It ensures that both amd64 and arm64 variants are included under the latest tag.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.22%. Comparing base (1b05c7a) to head (9b9dad2).
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #479   +/-   ##
=======================================
  Coverage   79.22%   79.22%           
=======================================
  Files         133      133           
  Lines       13204    13204           
=======================================
  Hits        10460    10460           
  Misses       2326     2326           
  Partials      418      418           
Flag Coverage Δ
unittests 79.22% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@creativeprojects creativeprojects added the enhancement New feature or request label Mar 30, 2025
@creativeprojects creativeprojects added this to the v0.30.0 milestone Mar 30, 2025
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/snapshot.yml (1)

65-74: New Publishing Step for GitHub Container Registry.
The new step for publishing images to the GitHub Container Registry mirrors the DockerHub process, handling both pushing and manifest operations for multiple image tags. While the implementation is clear and functional, you might consider refactoring the manifest creation steps in the future to reduce duplication and improve maintainability.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 598f2b9 and 9b9dad2.

📒 Files selected for processing (3)
  • .github/workflows/docker.yml (1 hunks)
  • .github/workflows/release.yml (2 hunks)
  • .github/workflows/snapshot.yml (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/docker.yml
  • .github/workflows/release.yml
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build and test (1.24, windows-latest)
🔇 Additional comments (3)
.github/workflows/snapshot.yml (3)

4-4: Manual Trigger Added for Workflow Dispatch.
The addition of workflow_dispatch to the workflow triggers greatly improves flexibility by allowing manual execution. This is particularly useful for on-demand testing and deployments.


34-40: New Login Step for GitHub Container Registry.
The new login step using docker/login-action@v3 is well-configured to authenticate with ghcr.io using the GitHub actor’s username and token from secrets. Please ensure that the GITHUB_TOKEN provided has the necessary permissions to push images to the GitHub Container Registry.


55-63: Explicit Shell Specification for DockerHub Publishing.
Specifying shell: bash in the "Publish to DockerHub" step is a good enhancement for ensuring that multi-line shell commands execute as intended across different environments.

@creativeprojects creativeprojects merged commit 07df141 into master Mar 30, 2025
9 checks passed
@creativeprojects creativeprojects deleted the upload-to-gcr branch March 30, 2025 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Publish to GH Container Registry

1 participant